import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import VueCookies from 'vue-cookies'

const routes = [{
		// 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
		path: "/:pathMatch(.*)*",
		name: "home",
		component: () => import('../views/Home.vue')
	},
	{
		path: '/login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/home',
		component: () => import('../views/Home.vue')
	},
	{
		path: '/usedcar',
		component: () => import('../views/Usedcar.vue')
	},
	{
		path: '/personal',
		component: () => import('../views/Personal.vue')
	},
	{
		path: '/page/detail',
		component: () => import('../views/page/UsedcarDetail.vue')
	},
	{
		path: '/page/sellerShop',
		component: () => import('../views/page/SellerShop.vue')
	},
	{
		path: '/page/sellerMap',
		component: () => import('../views/page/SellerMap.vue')
	},
	{
		path: '/page/todayUsedcar',
		component: () => import('../views/page/TodayUsedcar.vue')
	},
	{
		path: '/user/collection',
		component: () => import('../views/user/Collection.vue')
	},
	{
		path: '/user/myInfo',
		component: () => import('../views/user/UserInfo.vue')
	},
	{
		path: '/user/question',
		component: () => import('../views/user/Question.vue')
	}
]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router
